#pragma once

#include "My_RBTree.h"

template<class K>
class My_set
{

	struct SetKeyOrValue
	{
		const K& operator()(const K& key)
		{
			return key;
		}
	};

public:
	typedef typename RBTree< K, K, SetKeyOrValue>::iterator iterator;
	typedef typename RBTree< K, K, SetKeyOrValue>::const_iterator const_iterator;

	iterator begin()
	{
		return _RBT.begin();
	}
	iterator end()
	{
		return _RBT.end();
	}

	const_iterator begin()const
	{
		return _RBT.begin();
	}
	const_iterator end()const
	{
		return _RBT.end();
	}

	pair<iterator, bool> Insert(const K& key)
	{
		return _RBT.Insert(key);
    }

	void print()const
	{
		_RBT.print_tree();
	}

	iterator Find(const K& key)
	{
		return _RBT.Find(key);
	}
private:
	RBTree< K, K, SetKeyOrValue> _RBT;
};